package com.share.example.javafx.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.share.example.javafx.mapper.UserMapper;
import com.share.example.javafx.model.User;
import com.share.example.javafx.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户表  服务实现类
 * </p>
 *
 * @author author
 * @since 2022-01-10
 */
@Slf4j
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User login(String account) {
        User user = userMapper.selectOne(Wrappers.<User>query().eq("account", account).eq("status", 1));
        return user;
    }
}
